<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="module">
        import * as THREE from 'https://threejs.org/build/three.module.js';
        import { OrbitControls } from 'https://threejs.org/examples/jsm/controls/OrbitControls.js';
        let renderer, scene, camera;
        renderer = new THREE.WebGLRenderer({ antialias: true });
        renderer.setSize(window.innerWidth, window.innerHeight);
        renderer.shadowMap.enabled = true;
        renderer.shadowMap.type = THREE.PCFSoftShadowMap;
        document.body.appendChild(renderer.domElement);
        camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 1000);
        camera.position.set(2, 4, 10);
        camera.lookAt(new THREE.Vector3(0, 0, 0));
        let controls = new OrbitControls(camera, renderer.domElement);
        scene = new THREE.Scene();
        scene.add(new THREE.AmbientLight(0x444444));
        let light = new THREE.PointLight(0xffffff);
        light.position.set(15, 30, 10);
        light.castShadow = true;
        scene.add(light);
        const geometry = new THREE.BoxGeometry(1, 1, 1);
        const material = new THREE.MeshPhongMaterial({ color: 0x00ff00 });
        const cube = new THREE.Mesh(geometry, material);
        scene.add(cube);

        animate();
        function animate() {
            render();
            // stats.update();
            controls.update();
            requestAnimationFrame(animate);
        }
        function render() {
            renderer.render(scene, camera);
        }
    </script>
</body>

</html>